package com.example.demo.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 角色表
 * @author zmf
 */
@Entity
@Table(name="cs_sm_role_d")
@ApiModel("角色信息")
public class Role implements Serializable {

    private static final long serialVersionUID = -6266877399109394122L;
    @Id
    /*@SequenceGenerator(name = "ROLE_SEQ", sequenceName = "S_AAS_ROLE", allocationSize = 1)*/
    /*@GeneratedValue(strategy = GenerationType.IDENTITY, generator = "ROLE_SEQ")*/
    @Column(name = "CS_SM_ROLE_ID")
    @ApiModelProperty("角色ID")
    private Long roleId;

    @ApiModelProperty("角色名")
    @Column(name = "ROLE_NAME", nullable = false, unique = true)
    private String roleName;

    @ApiModelProperty("角色名")
    @Column(name = "ROLE_CODE")
    private String roleCode;

    @ApiModelProperty("上级角色ID")
    @Column(name = "PARENT_ID")
    private Long  parentRoleId;

    /*@ApiModelProperty("角色状态")
    @Column(name = "ENABLED",nullable = false)
    private Integer enabled = 1;*/

    @ApiModelProperty("描述信息")
    @Column(name = "DESCRIPTION")
    private String description;

    @ApiModelProperty("角色类型:1角色,2目录")
    @Column(name = "ROLE_FLAG",nullable = false)
    private Integer roleFlag = 1;

    /*@ApiModelProperty("创建人ID")
    @Column(name = "CREATE_USER_ID", nullable = false,updatable = false)
    private Long createUserId;*/

    @ApiModelProperty("创建人")
    @Column(name = "CREATE_USER_NAME", nullable = false,updatable = false)
    private String createUserName;

    @ApiModelProperty("插入时间")
    @Column(name = "CREATE_TIME", nullable = false,updatable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date insertTime;

    @ApiModelProperty("更新时间")
    @Column(name = "UPDATE_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    private Date updateTime;

    /*@ApiModelProperty("更新人ID")
    @Column(name = "UPDATE_USER_ID")
    private Long updateUserId;*/

    @ApiModelProperty("更新人")
    @Column(name = "UPDATE_USER_NAME")
    private String updateUserName;

    @ApiModelProperty("全量角色ID")
    @Column(name = "FULL_ROLE_ID")
    private String fullRoleId;

    @ApiModelProperty("区域ID")
    @Column(name = "CS_SM_REGION_ID")
    private Long regionId;

    @ApiModelProperty("全量区域ID")
    @Column(name = "FULL_REGION_ID")
    private String fullRegionId;

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public Long getParentRoleId() {
        return parentRoleId;
    }

    public void setParentRoleId(Long parentRoleId) {
        this.parentRoleId = parentRoleId;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getRoleFlag() {
        return roleFlag;
    }

    public void setRoleFlag(Integer roleFlag) {
        this.roleFlag = roleFlag;
    }

    public String getCreateUserName() {
        return createUserName;
    }

    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }

    public Date getInsertTime() {
        return insertTime;
    }

    public void setInsertTime(Date insertTime) {
        this.insertTime = insertTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getUpdateUserName() {
        return updateUserName;
    }

    public void setUpdateUserName(String updateUserName) {
        this.updateUserName = updateUserName;
    }

    public String getFullRoleId() {
        return fullRoleId;
    }

    public void setFullRoleId(String fullRoleId) {
        this.fullRoleId = fullRoleId;
    }

    public Long getRegionId() {
        return regionId;
    }

    public void setRegionId(Long regionId) {
        this.regionId = regionId;
    }

    public String getFullRegionId() {
        return fullRegionId;
    }

    public void setFullRegionId(String fullRegionId) {
        this.fullRegionId = fullRegionId;
    }

    public String getRoleCode() {
        return roleCode;
    }

    public void setRoleCode(String roleCode) {
        this.roleCode = roleCode;
    }

    @Override
    public String toString() {
        return "Role{" +
                "roleId=" + roleId +
                ", roleName='" + roleName + '\'' +
                ", roleCode='" + roleCode + '\'' +
                ", parentRoleId=" + parentRoleId +
                ", description='" + description + '\'' +
                ", roleFlag=" + roleFlag +
                ", createUserName='" + createUserName + '\'' +
                ", insertTime=" + insertTime +
                ", updateTime=" + updateTime +
                ", updateUserName='" + updateUserName + '\'' +
                ", fullRoleId='" + fullRoleId + '\'' +
                ", regionId=" + regionId +
                '}';
    }
}
